package com.ruoyi.system.task;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.IJiajiaOrderService;
import org.springframework.stereotype.Component;
import cn.hutool.core.date.DateUtil;

import javax.annotation.Resource;
import java.util.Date;

/**
 * 定时任务社工订单结算
 * 
 * @author mrwang
 */
@Component("workerOrderSettle")
public class OrderSettleTask {
    @Resource
    private IJiajiaOrderService jiajiaOrderService;
    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
    {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void executeOrderSettle(String params)
    {
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams()
    {
        System.out.println("执行无参方法");
    }

    public void settleAccounts(){
        Date startTime = new Date();
        Date endTime = DateUtil.offsetDay(startTime, 15);
        jiajiaOrderService.settleAccounts(startTime, endTime);
    }
}
